using Cysharp.Threading.Tasks;
using GameFramework.Configuration;
using GameFramework.Fsm;
using GameFramework.Procedure.Attribute;
using GameLogic.Login;

namespace GameLogic.Launch
{
    /// <summary>
    /// 加载配置表流程
    /// </summary>
    [Procedure]
    public sealed class LoadConfigProcedure : ALaunchStepProcedure
    {
        protected override LaunchStep Step => LaunchStep.LoadConfig;
        protected override UniTask<int> ExecuteStep()
        {
            return ConfigurationService.That.LoadAsync();
        }

        protected override void OnCompleteUpdate(IFsm fsm)
        {
            Change<LoginProcedure>(fsm);
        }
    }
}